﻿#region Using directives

using System;
using System.Collections.Generic;
using System.Text;

using Weazel.Badger.Vhdl.Types;
using Weazel.Badger.Vhdl.Expressions;

#endregion

namespace Weazel.Badger.Vhdl.Statements
{
  public class CaseStatementChoice
  {
    private Expression expression;
    public Expression Expression
    {
      get
      {
        return expression;
      }

      set
      {
        expression = value;
      }
    }

    private StatementCollection statements = new StatementCollection();
    public StatementCollection Statements
    {
      get
      {
        return statements;
      }
    }

		public void Resolve(Entity entity, Process process, StatementCollection statements)
    {       
      this.statements.Resolve(entity, process, this.statements);
    }

    public void Verify(ref List<VerifyMessage> messages)
    {
      statements.Verify(ref messages);
    }

    public CaseStatementChoice(Expression expression)
    {
      this.expression = expression;
    }

    public void Write(System.CodeDom.Compiler.IndentedTextWriter writer)
    {
      writer.WriteLine("when {0} =>", expression.ToString());
      writer.Indent++;

      statements.Write(writer);

      writer.Indent--;
    }
  }
}
